<%@ page import="com.dmp.onlinestore.model.dto.ProductBean" %>
<%@ page import="java.util.List" %>
<%@ page import="com.dmp.onlinestore.view.base.ViewAddressFactory" %>
<%@ page import="com.dmp.onlinestore.view.base.ViewDefs" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>     
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<%
//Context root for this application.
String contextPath = request.getContextPath();
String servletMapping = ViewDefs.getServletMapping();
// List of products.
String prodAttr = ViewDefs.ATTR_PRODUCT_LIST;
//List<ProductBean> productList = (List<ProductBean>) request.getAttribute(prodAttr);
//String actionField = ViewUtilities.REQUEST_FIELD_ACTION;
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>JWAD</title>
	
	<link href="<%=contextPath%>/css/css.css" type="text/css" rel="stylesheet">
</head>
<body>
	<div id="container">
		<div id="header">
			<h1>JWAD Online Music Catalog</h1>
			<p class="description">Great music and a reasonable price.</p>
			
		</div>
		<table id="nav_result_cnt" width="100%" cellspacing="0" cellpadding="0">
		  <tbody>
		    <tr>
		      <td><span class="result_cnt">Results 1 - 10 of 1044</span></td>
		      <td align="right">
		          <form method="GET" name="FRMSORT" action="<%=contextPath%>/Controller">
		          	  <input type="hidden" value="getProducts" name="action"/>
		              <input type="hidden" value="pageSize" name="changepage"/>  
		              <select name="newSize" onchange="this.form.submit();">
		                  <option value="5">Display 5 per page</option>
		                  <option value="10">Display 10 per page</option>
		                  <option value="15">Display 15 per page</option>
		              </select>	
           
		          </form>
		      </td>
		    </tr>
		  </tbody>
		</table>		
		<div id="wrapper">
			<div id="content">
				<form method="GET" action="<%=contextPath%><%=servletMapping%>/Cart.asp">
					<table cellspacing="0" id="nav_results">
					
						<c:forEach var="pb" items="${prodList}">
							<jsp:useBean id="pb" class="com.dmp.onlinestore.model.dto.ProductBean"/>
							<tr>
								<td align="center"><input type="checkbox" name="item" value="${pb.id}"/><p class="nav_compare">ADD</p></td>
								<td width="130" class="nav_img" align="center"><a href="ItemDesc?id=${pb.id}"> <IMG height="120" width="120" SRC="<%=contextPath%>/images/item/${pb.id}.jpg" ALT="????"></a></td>
								
								<td class="nav_content" width="100%">
									<h4><a href="<%=contextPath%>/ItemDesc.asp?item=${pb.id}">${pb.name}</a></h4>
									<p>By ${pb.performers}</p><p>${pb.descShort}</p>
									<p class="srFreeShip">Item Ships Free!</p>
									<p class="srPrice"><a href="<%=contextPath%>/Cart.asp?item=${pb.id}">Buy New: $ ${pb.price}</a></p>
									<img src="<%=contextPath%>/images/ratings/rating${pb.rating}.gif" alt="Overall: ${pb.rating}"/>
								</td>
							</tr>
							<tr>
								<td colspan="3" style="background:url(<%=contextPath%>/images/dotted_bg_yellow.gif) repeat-x"><IMG SRC="images/clear.gif" HEIGHT="1" WIDTH="1" BORDER="0"/></td>
							</tr>						
						</c:forEach>
				
					</table>
				</form>

			</div>
		</div>
		
		<div id="navigation">
			<h2>Category</h2>
			<ul>
				<li><a href="">Category 1</a></li>
				<li><a href="">Category 2</a></li>
				<li><a href="">Category 3</a></li>
				<li><a href="">Category 4</a></li>
				<li><a href="">Category 5</a></li>
				<li><a href="">Category 6</a></li>
			</ul>
			<h2>PRICE</h2>
			<ul>
				<li><a href="">Price Range 1</a></li>
				<li><a href="">Price Range 2</a></li>
				<li><a href="">Price Range 3</a></li>
				<li><a href="">Price Range 4</a></li>
				<li><a href="">Price Range 5</a></li>
				<li><a href="">Price Range 6</a></li>
			</ul>
			<h2>Year</h2>
			<ul>
				<li><a href="">2009</a></li>
				<li><a href="">2008</a></li>
				<li><a href="">2007</a></li>
				<li><a href="">2006</a></li>
				<li><a href="">2005</a></li>
				<li><a href="">2004</a></li>
				<li><a href="">2003</a></li>
				<li><a href="">2002</a></li>
				<li><a href="">2001</a></li>
				<li><a href="">2000</a></li>
			</ul>
		</div>
		
		<div id="footer">
			<ul>
				<li><a href="">Navigation 1</a></li>
				<li><a href="">Navigation 2</a></li>
				<li><a href="">Navigation 3</a></li>
				<li><a href="">Navigation 4</a></li>
				<li><a href="">Navigation 5</a></li>
				<li><a href="">Navigation 6</a></li>
			</ul>
			<p>Footer stuff goes here. Copyright, disclaimers &ndash; stuff like that.</p>
		</div>
	</div>
</body>
</html>
